Skip to content

Conversation

@AHaliq
Copy link

@AHaliq AHaliq commented Aug 28, 2025

Purpose

Guard serde relevant constructs behind a feature flag eventually to be turned off by default

Changes

  • created a tool to parse and transform rust AST to add the guards idempotently
  • run cd serde-refactor && cargo run -- ../concordium-rust-sdk/src --dry-run to see candidates in src
  • apply transformation to src/** and examples/**

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

CLA acceptance

By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0

@AHaliq AHaliq requested a review from allanbrondum August 28, 2025 11:11
@AHaliq AHaliq self-assigned this Aug 28, 2025
@AHaliq AHaliq added [Size] Large [Type] Maintenance Cleanup or handling of technical debt. question Further information is requested Breaking change labels Aug 28, 2025
@AHaliq AHaliq marked this pull request as draft August 28, 2025 11:11
@AHaliq AHaliq force-pushed the serde_deprecated branch 7 times, most recently from e8c4d78 to 323233a Compare September 1, 2025 10:20
@AHaliq AHaliq marked this pull request as ready for review October 6, 2025 08:59
@AHaliq AHaliq changed the title [DRAFT] COR-1759 Serde deprecated COR-1759 Serde deprecated Oct 6, 2025
@AHaliq AHaliq force-pushed the serde_deprecated branch 3 times, most recently from c8544c7 to 69e9ac5 Compare November 5, 2025 08:43
@AHaliq AHaliq marked this pull request as draft November 5, 2025 08:44
@AHaliq AHaliq changed the title COR-1759 Serde deprecated RUN-41 Serde deprecated Nov 5, 2025
@AHaliq AHaliq marked this pull request as ready for review November 10, 2025 13:09
Comment on lines +5 to +9
- `internal::timestamp_millis`
- `internal::account_amounts`
- `internal::duration_millis`
- `types::smart_contracts::contract_trace_Via_events`
- `types::summary_helper`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that none of these are public, so we don't need to mention them

- `internal::duration_millis`
- `types::smart_contracts::contract_trace_Via_events`
- `types::summary_helper`
- serde relevant `derive`s and `impl`s guarded by flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the formulation you used in the readme is more precise. "The flag serde_deprecated now guards serde::Serialize and serde::Deserialize implementations on the following types. The implementations will eventually be removed".

Derive is just an implementation detail of how the traits are implemented and is not really relevant to mention.

- `types::smart_contracts::instance_parser::InstanceInfoHelper`
- `types::smart_contracts::ContractContext`
- `types::smart_contracts::InvokeContractResult`
- `examples::update-validator-score-param::main` test to print results when flag disabled; without serde
Copy link
Contributor

@allanbrondum allanbrondum Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the change to examples is not really notable enough to mention (but not a big deal, we just need some filter of notability in what we mention)

- `types::queries::PendingUpdate`
- `types::queries::PendingUpdateEffect`
- `types::smart_contracts::InstanceInfo`
- `types::smart_contracts::instance_parser::InstanceInfoHelper`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InstanceInfoHelper is also not public?

- `types::StakePendingChange`
- `types::RewardsOverview`
- `types::CommonRewardData`
- `types::reward_overview::RewardsDataRaw`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not public?

Copy link
Contributor

@allanbrondum allanbrondum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have a few comments for making changelog more precise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking change question Further information is requested [Size] Large [Type] Maintenance Cleanup or handling of technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants